home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 133 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. From: hough@aai.com (Al Hough)
  2. Message-ID: <9601242252.AA08579@fermat.aai.com>
  3. X-Original-Date: Wed, 24 Jan 96 17:52:15 EST
  4. Path: in2.uu.net!bounce-back
  5. Date: 25 Jan 96 05:29:36 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Organization: -
  8. Newsgroups: comp.std.c++
  9. Subject: STL sets have mutable iterators?
  10. Reply-To: hough@aai.com
  11. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  12.     iQBFAgUBMQcVS+EDnX0m9pzZAQEnvgF6AuTVk3AyTG/L4cYlHN1a4smuc8e2WEja
  13.     +9MKk/OaH2FT9dBuEYdu/LoLtWLWlHSX
  14.     =vAcz
  15.  
  16. In my April 95 copy of the DWP, I couldn't find any requirement
  17. that a set iterator be a const_iterator. Previous STL documentation
  18. required that for sets, an iterator was a const_iterator, thus
  19. insuring that the return type from dereferencing a set<T>::iterator
  20. was a const T& and not a T&.  I agreed with the behavior that a
  21. set iterator should yield const T&, because yielding a T& would
  22. allow users to break the "uniqueness" of the set by allowing the
  23. possiblility that a user could modify an existing value in the
  24. set so that it became equal to another value in the set.
  25.  
  26. What was intended here?
  27.  
  28. --
  29. Al Hough                            email: hough@aai.com
  30. Amerinex Artificial Intelligence    phone: (413) 256-8941   
  31. ---
  32. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  33.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  34.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  35.